sonic_heroes_modfandomcom-20200214-history
Transparency Functions
Alpha operations are mechanical material flags coded into RenderWare executable files. The purpose of these is to apply the desired alpha blending channel for a specific model or other object used in-game and combine the source blend into the background. Alpha Blending A number of operations used for the engine in the game come from OpenGL including the blend equation used to make a number of things like shadows, Espio's invisibility and particles. The blend operations combine the source and destination color pixels. On the PC and Xbox versions of Sonic Heroes, the exe checks if the model has transparent parts used before activating the use of different opacity modes. If the blend id on the opcode for a section has been changed through Cheat Engine, then the channel automatically changes. Other systems change it regardless of it's opacity like the GameCube version. List of byte functions 1 = Zero 2 = One 3 = Source Color 4 = Inverse Source Color 5 = Source Alpha 6 = Inverse Source Alpha 7 = Destination Alpha 8 = Inverse Destination Alpha 9 = Destination Color 10 = Inverse Destination Color 11 = Source Alpha Saturate Examples Alpha Testing The alpha test clips the multisample pixels for textures with 16bit alpha resulting in aliasing transparent edges. All 3D objects that use those (which are read through each TXD file) go through the main material routine like any other objects that do not use their personal blend codes as part of their object behavior functions. Editing blend codes Blend codes can be edited using a Hex editor. They vary by different values for each routine on object behaviors. For the windows version, install "Cheat Engine" and use it on the executable file while running. The blend operation codes are usually operated like this: /* Source Blend */ push push 0A call 0064C9B0 /* Destination Blend */ push push 0B call 0064C9B0 Miscellaneous gameplay routines have 13 as the source blend and 14 as the destination blend value (with the comparitive opcode being in use to allow anything with an additive state to use the 2nd blend id instead of the 6th one). The GameCube and PS2 has the same byte id values "0A and 0B" used in their main executable files like .dol. For GameCube versions, they have a code structure pattern of: Source operation: li r3, 10 li r4, (source blend value) Hexidecimal: 3860000A Destination operation: li r3, 11 li r4, (dest. blend value) Hexidecimal: 3860000B Playstation 2 has it's blend opcodes in their reversed Endian code. An example of it shows here: Opcodes: addiu a1, zero, $0002 addiu a0, zero, $000B Hex: 02 00 05 24 0B 00 04 24 Opcodes: addiu a1, zero, $0002 Hex: 02 00 05 24 Particles Each particle in the particle binary files has 4 byte parameter entries providing special effects for the objects. To edit it, open up a (stage or cmn)_ptcl.bin in a Hex editor and find the value to a particle object next to the bytes "05 00". The following values by the entry are shown here: SH_Particle_Alpha.png|02/08 = Alpha SH_Particle_Add.png|04 = Add SH_Particle_Subtract.png|10 = Subtract Gallery SH_Additive_Alpha_Test.png Notes *The PlayStation 2 version supports a limited amount of alpha blend modes due to it's limitations. Category:Textures and Materials Category:Mechanics